package com.jketing.tag;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.jsp.JspException;
import javax.servlet.jsp.JspWriter;
import javax.servlet.jsp.tagext.Tag;
import javax.servlet.jsp.tagext.TagSupport;

/**
 * 功能导航
 * @author Administrator
 *
 */
public class NavTag extends TagSupport {
	/**
	 * 功能编号
	 */
	public String fid;
	
	/**
	 * 设置文本
	 */
	public String text;
	
	public int doStartTag() throws JspException {
		HttpServletRequest request = (HttpServletRequest) pageContext.getRequest();
		HttpServletResponse response = (HttpServletResponse) pageContext.getResponse();
		JspWriter out = pageContext.getOut();
		String rel = "";
		//处理   css image  icon
		try {
			String navStr = "当前位置<b style='font-size:9pt'>：</b>&nbsp;";
			
				navStr+=""+"<b style='font-size:9pt'>&nbsp;»&nbsp;</b>"+"";
			
			if(text != null && !"".equals(text)){
				navStr+=text;
			}
			request.setCharacterEncoding("iso8859-1");
			
			if(request.getParameter("navText") != null){
				navStr+=new String(request.getParameter("navText"));
			}
			
//			navStr = new String(request.getParameter("navText").getBytes("iso8859-1"));
			out.print(navStr);
		} catch (Exception ex) {
			ex.printStackTrace();
		}
		return Tag.SKIP_BODY;
	}

	public String getFid() {
		return fid;
	}

	public void setFid(String fid) {
		this.fid = fid;
	}

	public String getText() {
		return text;
	}

	public void setText(String text) {
		this.text = text;
	}
}
